package com.mondo.financialwallet.presentation.ui.dialog;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetDialog;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.mondo.financialwallet.R;
import com.mondo.financialwallet.data.params.TokenTransferParams;

import butterknife.Bind;

public class PayDetailsBottomDialog extends BottomSheetDialog {

    private TextView mToAddressTextView;
//    private TextView mFromAddressTextView;
    private TextView mGasTextView;
    private TextView mRemarkTextView;
    private TextView mAmountTextView;
    private Button mConfirmTransferView;

    public PayDetailsBottomDialog(@NonNull Context context) {
        super(context);
        setContentView(R.layout.dialog_pay_details);
        mToAddressTextView = findViewById(R.id.to_address_text_view);
//        mFromAddressTextView = findViewById(R.id.from_address_text_view);
        mGasTextView = findViewById(R.id.gas_text_view);
        mRemarkTextView = findViewById(R.id.remark_text_view);
        mAmountTextView = findViewById(R.id.amount_text_view);
        mConfirmTransferView = findViewById(R.id.confirm_transfer_view);
    }

    public void show(TokenTransferParams params, View.OnClickListener listener) {
        mToAddressTextView.setText(params.getToAddress());
//        mFromAddressTextView.setText(params.getFromAddress());
        mGasTextView.setText(params.getGas());
        mRemarkTextView.setText(params.getRemark());
        mAmountTextView.setText(String.valueOf(params.getAmount()));
        mConfirmTransferView.setOnClickListener(v -> {
            dismiss();
            listener.onClick(v);
        });
        this.show();
    }
}
